<template>
  <div>
    <el-table v-loading="loading" border stripe size="medium" :data="data">
      <el-table-column width="220px" prop="id" label="任务ID" align="center"></el-table-column>
      <el-table-column prop="topChannelCode" label="顶级渠道" align="center">
        <template slot-scope="scope">{{ formatTopChannel(scope.row.topChannelCode) }}</template></el-table-column
      >
      <el-table-column prop="channelNum" label="子渠道数" align="center"> </el-table-column>
      <el-table-column prop="goodsNum" label="商品数量" align="center"> </el-table-column>
      <el-table-column prop="period" label="执行时段" align="center" width="150"> </el-table-column>
      <!-- <el-table-column prop="successNum" label="成功" align="center"> </el-table-column>
      <el-table-column prop="failureNum" label="失败" align="center"> </el-table-column> -->
      <el-table-column prop="status" label="执行状态" align="center">
        <template slot-scope="scope">{{ formatStatus(scope.row.status) }}</template></el-table-column
      >
      <el-table-column prop="creator" label="创建人" align="center"> </el-table-column>
      <el-table-column prop="createTime" label="创建时间" align="center" width="170px">
        <template slot-scope="scope">{{ formatTime(scope.row.createTime) }}</template>
      </el-table-column>
      <el-table-column prop="lastModify" label="更新时间" align="center" width="170px">
        <template slot-scope="scope">{{ formatTime(scope.row.lastModify) }}</template></el-table-column
      >
      <el-table-column prop="operate" label="操作" align="center" width="160px">
        <template slot-scope="scope">
          <el-button @click="onCancelTask(scope.row)" type="text" size="mini">取消任务</el-button>
          <el-button @click="onTaskRecord(scope.row)" type="text" size="mini">任务执行记录</el-button>
        </template>
      </el-table-column>
    </el-table>
    <div :class="$style.tablePagination">
      <el-pagination
        @size-change="onPageSizeChange"
        @current-change="onPageNumChange"
        :current-page="currentPage"
        :page-sizes="[10, 20, 30, 40, 50, 100]"
        :page-size="pageSize"
        layout="sizes, prev, pager, next, jumper, total"
        :total="total"
        :hide-on-single-page="false"
      />
    </div>
  </div>
</template>

<script>
import Index from './index';
export default Index;
</script>

<style lang="scss" module>
@import './index.module.scss';
</style>
